Skip to content

feat(environments): make environment list columns sortable - #3020

Merged
RemiBonnet merged 2 commits into
stagingfrom
feat/environment-list-sortable-columns
Sep 28, 2026
Merged

RemiBonnet merged 2 commits into
stagingfrom
feat/environment-list-sortable-columns

Conversation

@RemiBonnet

@RemiBonnet RemiBonnet commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Issue: Make environment table columns sortable with the same three-state interaction as the service list.

  • Environment, Last operation, Cluster, and Last update sort on click: ascending, descending, then back to the section's default order.
  • Keep the initial order and hide the arrow until a user selects a sort. Ephemeral environments start with the most recent operation; other sections start alphabetically.
  • Add Last operation sorting to the service list with the same interaction.
  • Report the effective sort through aria-sort on both tables, including the default environment sort, without showing an initial arrow.
  • Use one stable current-time fallback per environment sort for rows without updated_at.

Screenshots / Recordings

Header arrows appear only after a sorting click.

Testing

  • Changes tested locally in the relevant Console pages and Storybooks
  • EnvironmentSection tests: 11 passed
  • ServiceList tests: 10 passed; snapshot updated and reviewed
  • Prettier on changed source and test files
  • ESLint on changed source and test files (0 errors; one pre-existing hook dependency warning)
  • Full yarn test, yarn format, and yarn lint

PR Checklist

  • Followed naming, styling, and TypeScript rules
  • Performed a self-review of the focused diff
  • Titled the PR using Conventional Commits with a scope
  • Kept only necessary comments, written in English
  • Involve a designer to validate the UI change
  • Covered new sorting behavior with unit tests
  • Confirm CI is green on the latest commit

@nx-cloud

nx-cloud Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 87f36b4

Command Status Duration Result
nx run console:build --parallel=3 --configurati... ✅ Succeeded 1m 27s View ↗
nx affected --target=test --parallel=3 --config... ✅ Succeeded 2m 59s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 2m 46s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 7s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-28 07:43:32 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 3/5

  • In libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx, the unanchored role query matches both row links and nested environment anchors, so the assertion receives four links and the test fails; restrict the query to the individual environment anchor.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx">

<violation number="1" location="libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx:171">
P2: This unanchored role query also matches each row’s `role="link"` in addition to its nested environment anchor, so the assertion receives four links and the new test fails. Restrict the accessible name to the individual environment anchors.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

)

const getEnvironmentNames = () =>
screen.getAllByRole('link', { name: /alpha|beta/i }).map((link) => link.textContent)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This unanchored role query also matches each row’s role="link" in addition to its nested environment anchor, so the assertion receives four links and the new test fails. Restrict the accessible name to the individual environment anchors.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx, line 171:

<comment>This unanchored role query also matches each row’s `role="link"` in addition to its nested environment anchor, so the assertion receives four links and the new test fails. Restrict the accessible name to the individual environment anchors.</comment>

<file context>
@@ -157,6 +157,45 @@ describe('EnvironmentSection', () => {
+    )
+
+    const getEnvironmentNames = () =>
+      screen.getAllByRole('link', { name: /alpha|beta/i }).map((link) => link.textContent)
+
+    expect(getEnvironmentNames()).toEqual(['Alpha', 'Beta'])
</file context>
Suggested change
screen.getAllByRole('link', { name: /alpha|beta/i }).map((link) => link.textContent)
screen.getAllByRole('link', { name: /^(Alpha|Beta)$/i }).map((link) => link.textContent)

@RemiBonnet
RemiBonnet force-pushed the feat/environment-list-sortable-columns branch from 1b1e094 to 71f741f Compare September 25, 2026 13:27

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.

Re-trigger cubic

@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.55556% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.25%. Comparing base (5322ea5) to head (87f36b4).
⚠️ Report is 3 commits behind head on staging.

Files with missing lines Patch % Lines
...-table/environment-section/environment-section.tsx 85.71% 2 Missing and 2 partials ⚠️
...ices/feature/src/lib/service-list/service-list.tsx 71.42% 0 Missing and 2 partials ⚠️
...feature/src/lib/hooks/use-services/use-services.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #3020      +/-   ##
===========================================
+ Coverage    50.84%   51.25%   +0.41%     
===========================================
  Files         1313     1287      -26     
  Lines        28937    28477     -460     
  Branches      8637     8653      +16     
===========================================
- Hits         14713    14596     -117     
+ Misses       11822    11472     -350     
- Partials      2402     2409       +7     
Flag Coverage Δ
unittests 51.25% <80.55%> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Allow sorting the environment list by clicking on column headers, with a
click toggling the direction between ascending and descending. Sortable
columns: Environment (name), Last operation, Cluster and Last update.

This mirrors the sortable behavior already used on the service rows
(arrow-down for ascending, arrow-up for descending) and exposes the
current sort state via aria-sort for accessibility.

Defaults are preserved: ephemeral environments still start sorted by the
most recent operation, other sections keep the alphabetical order.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RemiBonnet
RemiBonnet force-pushed the feat/environment-list-sortable-columns branch from 71f741f to 1852c31 Compare September 25, 2026 14:28

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 reviewed files. 1 file intentionally excluded from review.

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread libs/domains/services/feature/src/lib/service-list/service-list.tsx
@RemiBonnet
RemiBonnet merged commit d78175c into staging Sep 28, 2026
10 checks passed
@RemiBonnet
RemiBonnet deleted the feat/environment-list-sortable-columns branch September 28, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants